
<%@ page import="com.bafa.objects.*" %>

<% Match[] results = (Match[])request.getAttribute("RESULTS");
%>
<% Season season = (Season)request.getAttribute("CURRENTSEASON");   %>
<% User user = (User)session.getAttribute("LOGGEDON"); %>


<style type="text/css">

#Main {
	position:relative;
	width:701px;
	height:551px;
	z-index:1;
}
#Layer1 {
	position:absolute;
	width:252px;
	height:196px;
	z-index:2;
}

</style>

<link href="styles_5.css" rel="stylesheet" type="text/css" />

<link href="stats.css" rel="stylesheet" type="text/css" />


<style type="text/css">
<!--
#Resultstable {
	position:absolute;
	width:450px;
	height:115px;
	z-index:1;
	left: 100;
}
#Layer2 {
	position:absolute;
	width:450px;
	height:21px;
	z-index:1;
}
#Layer3 {
	position:absolute;
	width:450px;
	height:100px;
	z-index:2;
	top: 22;
}
-->
</style>
<div id="Main">
  <div id="Resultstable">
    <div class="avlh" id="Layer2">Results</div>
    <div id="Layer3">          <table class="bafatablelarge" width=100% border="0">

<%	for(int j=0;j<results.length;j++){
	Match match = results[j];
	String rowClass = "r1";
	if(j%2==0) rowClass="r2";
   %>
  <tr class="<%=rowClass%>">
    <td ><b><%=match.getDateOfMatch()%></b></td>
	<td><b><%=match.getTime()%></b></td>
    <td class="c2"><a href='team.bafa?SeasonId=<%=match.getSeasonId()%>&TeamId=<%=match.getTeamA()%>'><%=match.getTeamAName()%></a> - <b><%if(match.getGoalsA()>match.getGoalsB()){%><font color="#000099"><%}else if(match.getGoalsA()==match.getGoalsB()){%><font color="green"><%}else{%><font color="#CC0000"><%}%><%=match.getGoalsA()%></font></b></td>
    <td class="c2"><a  href='team.bafa?SeasonId=<%=match.getSeasonId()%>&TeamId=<%=match.getTeamB()%>'><%=match.getTeamBName()%></a> -  <b><%if(match.getGoalsB()>match.getGoalsA()){%><font color="#000099"><%}else if(match.getGoalsA()==match.getGoalsB()){%><font color="green"><%}else{%><font color="#CC0000"><%}%><%=match.getGoalsB()%></font></b></td>
    <td ><span class="nlpblack"><%if(match.isPlayed()&&!match.isConfirmed()){%>Unconfirmed Result<%}else if(match.isWalkover()){%>Walkover<%}%></span></td>
  </tr>
  <tr class="<%=rowClass%>">
    <%if(user!=null && user instanceof AdminUser){%>
        <td ><a href="displayreschedule.bafa?MatchId=<%=match.getID()%>"><b>Change Date</b></a><br/>
		
		
        	 <a href="deletefixture.bafa?matchId=<%=match.getID()%>"><b>Delete</b></a>
        </td>
        <%}else{%>
        <td></td>
    <%}%>
	<td></td>
    <td class="c2"><span class="nlp"><%for(int u=0;u<match.scorersA().length;u++){%><%=match.scorersA()[u]%>(<%=match.getScorersA().get(match.scorersA()[u])%>)<br/><%}%></span></td>
    <td class="c2"><span class="nlp"><%for(int u=0;u<match.scorersB().length;u++){%><%=match.scorersB()[u]%>(<%=match.getScorersB().get(match.scorersB()[u])%>)<br/><%}%></span></td>
    <td> <%if(user!=null && user instanceof AdminUser &&match.isPlayed()){%><a href='displayeditscorers.bafa?MatchId=<%=match.getID()%>&seasonId=<%=season.getID()%>'><b>Edit Scorers</b></a><br/>
        	 <%if(match.isPlayed()&&!match.isConfirmed()){%><a href='confirmresult.bafa?MatchId=<%=match.getID()%>&seasonId=<%=season.getID()%>'><b>Confirm Result</b></a><br/>
        	 <%}}%></td>
  </tr>
  
  
  <%}%>
</table></div>
  </div>
  
</div>
